package com.xmy.cultivate.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xmy.cultivate.entity.Staff;
import com.xmy.cultivate.entity.StaffRankingDetail;
import com.xmy.cultivate.mapper.StaffRankingDetailMapper;
import com.xmy.cultivate.service.IStaffRankingDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 排位详细 服务实现类
 * </p>
 *
 * @author hpiggy
 * @since 2023-05-16
 */
@Service
public class StaffRankingDetailServiceImpl extends ServiceImpl<StaffRankingDetailMapper, StaffRankingDetail> implements IStaffRankingDetailService {
    @Autowired
    StaffRankingDetailMapper staffRankingDetailMapper;

    /**
     * 排位数据显示
     *
     * @param wrapper 条件构造器
     * @param page    分页
     * @return 排位数据
     */
    @Override
    public IPage<StaffRankingDetail> listRankingData(Wrapper wrapper, IPage<?> page) {
        return staffRankingDetailMapper.listRankingData(wrapper, page);
    }

    /**
     * 排位及工龄
     *
     * @param wrapper
     * @return
     */
    @Override
    public List<StaffRankingDetail> listStaffRankingDetail(Wrapper wrapper) {
        return staffRankingDetailMapper.listStaffRankingDetail(wrapper);
    }

    @Override
    public Integer rankingNum(Long staffRankingId, Long staffId) {
        return staffRankingDetailMapper.rankingNum(staffRankingId, staffId);
    }

    @Override
    public List<StaffRankingDetail> staffAnalysis(Wrapper wrapper) {
        return staffRankingDetailMapper.staffAnalysis(wrapper);
    }
}
